<!--
 * @Descripttion: 
 * @Author: jiansheng
 * @Date: 2021-12-02 16:55:55
-->
<template>
  <div style="border: 1px solid blue;">
    <p @click="invokeParentFun">调用父组件方法</p>
    <p @click="invokeParentData">访问父组件属性</p>
  </div>
</template>
<script>
export default {
  data() {
    return {
      childNum: 99999
    }
  },
  methods: {
    clickBtn() {
      console.log('点击了子组件的按钮')
    },
    invokeParentFun() {
      this.$parent.parentClick()
    },
    invokeParentData() {
      console.log('打印父组件parentNum', this.$parent.parentNum)
    }
  },
}
</script>